﻿using Castle.ActiveRecord;
using Financial.Infra.DDD;
using Financial.Core.Modulos.ModuloUsuario;
using Financial.Core.Modulos.ModuloDevedor;
using Financial.Core.Modulos.ModuloCredor;
using System.Collections.Generic;
using System;
using Financial.Core.Modulos.ModuloParcela;

namespace Financial.Core.Modulos.ModuloDebito
{
    [ActiveRecord]
    public class Debito : IIdentifiable
    {
        [PrimaryKey]
        public int Id { get; set; }

        [BelongsTo("DEB_ID_DEVEDOR")]
        public Devedor Devedor { get; set; }

        [BelongsTo("DEB_ID_CREDOR")]
        public Credor Credor { get; set; }

        [BelongsTo("DEV_ID_USUARIO")]
        public Usuario Usuario { get; set; }

        [Property]
        public string DEB_STR_ESTABELECIMENTO { get; set; }

        [Property]
        public string DEB_TXT_DESCRICAO { get; set; }

        [Property]
        public double DEB_FL_VALOR { get; set; }

        [Property]
        public DateTime DEB_DT_DATA { get; set; }

        [Property]
        public Int16 DEB_INT_QTDPARCELA { get; set; }

        [Property]
        public bool DEB_BIT_ATIVO { get; set; }

        [HasMany(MapType = typeof(Parcela), Lazy = true, Inverse = true)]
        public IList<Parcela> Parcela { get; set; }
    }
}
